/**
 * 
 */
package brainbots.brains;

import brainbots.bot.Body;

public class RandomBrain implements Brain {
	private double t = 0;
	private double tmax = 15.0;
	private int curMotor = 0;

	public void simulate(double dt, Body bot){
	    t += dt;
	    if (t>tmax){
	        t-=tmax;
	        int newMotor = (int)(Math.random()*bot.getMotorCount());
	        bot.setMotor(curMotor, 0);
	        bot.setMotor(newMotor, 1);
	        curMotor = newMotor;
	    }
	}
}